package Generics_Reflect;

class TwoTuple<A,B>{
	final A first;
	final B second;
	public TwoTuple(A a, B b) {
		first=a;
		second=b;
	}
	public String toString(){
		return "("+first+", "+second+")";
	}
}

class ThreeTuple<A,B,C> extends TwoTuple<A, B>{
	public final C third;
	public ThreeTuple(A a, B b, C c){
		super(a,b);
		third=c;
	}
	public String toString(){
		return "("+first+", "+second+", "+third+")";
	}
}

public class TestTuple {
	public static void main(String[] args) {
		TwoTuple<String, Integer> t2=new TwoTuple<String, Integer>("Rower", 3);
		System.out.println(t2);
		ThreeTuple<String, Character, Double> t3 = new ThreeTuple<String, Character, Double>("Rolki", '*', 353.76);
		System.out.println(t3);
	}

}
